<?php
/**
* @author: Pham Van Diep
* @final: Truong Kim Phung
* @description: export javascript from language directory
*/
// check permission access file
if(!isset($AppUI) ||
    (isset($AppUI->type) && $AppUI->type != ROLE_ROOT)
) {
    redirect(HOST_BACKEND);
}
$arrOk	= array();
$lang   = $this->input->get('lang', null);
// export with language param
if(isset($lang)) {    
    CI_Function::exportJs($lang, $arrOk);    
} else {
    $langDir = LANGUAGE_DIR; 
    // scan dir export
    $langs   = scandir($langDir);
    if(isset($langs) && is_array($langs)) {
        foreach($langs as $lang) {
            if( $lang !== '.' && $lang !== '..' && $lang !== 'index.html') {
                CI_Function::exportJs($lang, $arrOk);
            }
        }
    }
}
$this->smarty->assign('arrOk', $arrOk);
$this->smarty->display('setting/locale.tpl');
       
